/*
 * CodePress regular expressions for Java syntax highlighting
 */
 
// Java
Language.syntax = [
	{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>'}, // strings double quote
	{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>'}, // strings single quote
	{ input : /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/g, output : '<b>$1</b>'}, // reserved words
	{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3'}, // comments //	
	{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' }// comments /* */
]

Language.snippets = [
	{ input : 'if', output : 'if($0){\n\t\n}' },
	{ input : 'ifelse', output : 'if($0){\n\t\n}\nelse{\n\t\n}' },
	{ input : 'else', output : '}\nelse {\n\t' },
	{ input : 'elseif', output : '}\nelseif($0) {\n\t' },
	{ input : 'do', output : 'do{\n\t$0\n}\nwhile();' },
	{ input : 'for', output : 'for(int i=0;i<$0;i++)\n{\n\n}' },
	{ input : 'sys', output : 'System.out.println("$0");'},
	{ input : 'sout', output : 'System.out.println("$0");'},
	{ input : 'syst', output : 'System.out.println($$0);'},
	{ input : 'try', output : 'try{\n\t$0\n}\ncatch(Exception e)\n\t{\n}'},
	{ input : 'dom', output : 'DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();\n        DocumentBuilder builder =fact.newDocumentBuilder();\n        Document doc = builder.parse("$0");\n        Node root =doc.getDocumentElement();        		\n		NodeList children = root.getChildNodes();\n		for (int i = 0; i < children.getLength(); i++){\n			Node n = children.item(i);\n				//System.out.println(n.getNodeName());\n		}' }	
]

Language.complete = [
	{ input : '\'',output : '\'$0\'' },
	{ input : '"', output : '"$0"' },
	{ input : '(', output : '\($0\)' },
	{ input : '[', output : '\[$0\]' },
	{ input : '{', output : '{\n\t$0\n}' }		
]

Language.shortcuts = []
